package structure.concrete;

import structure.interfaces.IOperatorBinary;

/**
 * this class represent the multiply operator in the chromosome
 * the class implements INode interface and therefore functions 
 * documentation can be found inside INode.java
 */
public class Multiply extends IOperatorBinary {

	@Override
	public double getValue(double x) {
		return left.getValue(x) * right.getValue(x);
	}

	@Override
	public String getDescription() {
		return "(" + left.getDescription() + "*" + right.getDescription() + ")";
	}

	public Multiply clone() {
		Multiply operator = new Multiply();
		operator.setLeft(left.clone());
		operator.setRight(right.clone());
		return operator;
	}
	
}
